// components/RefundIdxItem/RefundIdxItem.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    cardInfo: Object
  },

  data: {

  },
  toResetCardInfo: function() {
    wx.navigateTo({
      url: "/pages/creditCardReset/index"
    })
  },
  toSeeRecord: function() {
    wx.navigateTo({
      url: "/pages/refundRecord/index"
    })
  },
  toDeal: function() {
    if([1,2,5].find(cardInfo.state)) {
      // 去查看计划
      wx.navigateTo({
        url: "/pages/refundRecord/index"
      })
    }
  },

  transStatus: function (state) {
    const result = {
      "-1": { text: "无还款计划", color: "#333333", btnText: "我要还款" },
      "0": { text: "无还款计划", color: "#333333", btnText: "查看计划" },
      "1": { text: "无还款计划", color: "#333333", btnText: "查看计划" },
      "2": { text: "无还款计划", color: "#333333", btnText: "查看计划" },
      "3": { text: "无还款计划", color: "#333333", btnText: "查看计划" },
      "4": { text: "无还款计划", color: "#333333", btnText: "查看计划" },
      "5": { text: "无还款计划", color: "#333333", btnText: "查看计划" },
    }

    return result[`${state}`]
  },
  

  /**
   * 组件的方法列表
   */
  methods: {

  }
})
